package com.wanmait.demo.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wanmait.demo.mapper.ComponentMapper;
import com.wanmait.demo.pojo.Component;
import com.wanmait.demo.service.ComponentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class ComponentServiceimpl implements ComponentService {
    @Resource
    private ComponentMapper componentMapper;
    @Override
    public void insert(Component object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(Component object) {

    }

    @Override
    public Component findById(Integer id) {
        return null;
    }

    @Override
    public List<Component> findAll() {
        return null;
    }

    @Override
    public PageInfo<Component> findPage(int pageNum, int pageSize) {
        return null;
    }


    @Override
    public List<Component> selectcomponent() {
        return componentMapper.selectcomponent();
    }

    @Override
    public PageInfo<Component> findPagecomponent(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Component> components=componentMapper.selectcomponent();
        PageInfo<Component> pageInfo=new PageInfo<Component>(components,3);
        return pageInfo;
    }




}


